package com.hxc.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.hxc.entity.OperateLog;
import com.hxc.entity.PageBean;
import com.hxc.mapper.OperateLogMapper;
import com.hxc.service.OperateLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OperateLogServiceImpl implements OperateLogService {
    @Autowired
    private OperateLogMapper operateLogMapper;

    @Override
    public PageBean getLogPage(Integer page, Integer pageSize) {
        PageHelper.startPage(page, pageSize);
        List<OperateLog> logs = operateLogMapper.getLogPage();
        Page pages = (Page) logs;
        return new PageBean(pages.getTotal(),pages.getResult());
    }
}
